package com.lvhx.springboot.controller;

import com.lvhx.springboot.dynamicdatasource.DataSource;
import com.lvhx.springboot.entity.User;
import com.lvhx.springboot.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

// http://localhost:8087/testRemoveAbandonedTimeout
@RestController
public class MysqlTestController {

    @Autowired
    private UserMapper userMapper;

    @GetMapping("/testRemoveAbandonedTimeout")
//    @DataSource(value = "master")
    public String testRemoveAbandonedTimeout(){

        User user = userMapper.selectByPrimaryKey(1L);

        System.out.println("123");

        user.setCreateBy("testRemoveAbandonedTimeout");
        userMapper.updateByPrimaryKeySelective(user);
        return null;
    }


}
